< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03080801.xhp

(section: hex) (bookmark: bm_id3150616)
Hex function

Hex 関数

Hex Function [Runtime]
Hex 関数 [実行時](hd_id3150616.1)

Returns a string that represents the hexadecimal value of a number.
与えられた数値を 16 進数にした文字列を返します。(par_id3145136.2)

(/section: hex)

Syntax:
構文:(hd_id3147573.3)

Hex (Number)
Hex (Number)(par_id3150771.4)

Return value:
戻り値:(hd_id3147530.5)

String
文字列(par_id3159414.6)

Parameters:
パラメータ:(hd_id3156344.7)

Number: Any numeric expression that you want to convert to a hexadecimal number.
Number: 16 進数にする数値を示す表式。(par_id3148947.8)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3154365.9)

Sub ExampleHex
Sub ExampleHex(par_id3145420.29)

REM uses BasicFormulas in Office Calc
REM Office Calc タイプの関数を再現(par_id3156214.30)

Dim a2, b2, c2 as String
Dim a2, b2, c2 as String(par_id3153970.31)

a2 = "&H3E8"
a2 = "&H3E8"(par_id3154909.32)

b2 = Hex2Int(a2)
b2 = Hex2Int(a2)(par_id3148674.33)

MsgBox b2
MsgBox b2(par_id3155132.34)

c2 = Int2Hex(b2)
c2 = Int2Hex(b2)(par_id3150440.35)

MsgBox c2
MsgBox c2(par_id3147427.36)

End Sub
End Sub(par_id3147435.37)

Function Hex2Int( sHex As String ) As Long
Function Hex2Int( sHex As String ) As Long(par_id3148645.19)

REM Returns a Long-Integer from a hexadecimal value.
REM 16 進数値をロング整数に換算して返す(par_id3149262.20)

Hex2Int = clng( sHex )
Hex2Int = clng( sHex )(par_id3148616.21)

End Function
End Function(par_id3153952.22)

Function Int2Hex( iLong As Long) As String
Function Int2Hex( iLong As Long) As String(par_id3146984.24)

REM Calculates a hexadecimal value in Integer.
REM 整数値を 16 進数値に換算(par_id3147215.25)

Int2Hex = "&H" & Hex( iLong )
Int2Hex = "&H" & Hex( iLong )(par_id3148575.26)

End Function
End Function(par_id3151073.27)


< Prev / Next >